package day02;

/**
 * @author feng
 * @Date 2021/12/22 20:37
 * ? 类型通配符
 *
 */
public class Test {

    public static void main(String[] args) {
        Box<Number> box = new Box<>();
        box.setFirst(100);
        showBox(box);

        Box<Integer> box1 = new Box<>();
        box1.setFirst(200);
        showBox(box1);

    }

    public static void showBox(Box<? extends Number> box) {
        Number first = box.getFirst();
        System.out.println(first);
    }
}
